//
//  GTBMyselfMethod.m
//  GuTouBao
//
//  Created by zhaoshijie on 2018/4/22.
//  Copyright © 2018 zhaoshijie. All rights reserved.
//

#import "EBMLoginMethod.h"
#import "EBMBaseNavigationController.h"



@implementation EBMLoginMethod



/**
 进入登录界面

 @param viewController 跳转视图
 */
+ (void)naviagtionEnterLoginVCWithVC:(UIViewController *)viewController
{
    //  进入登录界面
    [self naviagtionEnterLoginVCWithVC:viewController loginSuccessBlock:nil];
}



/**
 进入登录界面
 
 @param viewController 跳转视图
 @param loginSuccessBlock 登录成功的回调
 */
+ (void)naviagtionEnterLoginVCWithVC:(UIViewController *)viewController
                   loginSuccessBlock:(OperationBlock)loginSuccessBlock
{
    
    
    [self normalLogin:viewController loginSuccessBlock:loginSuccessBlock];
}


//  正常的登录方式
+ (void)normalLogin:(UIViewController *)viewController loginSuccessBlock:(OperationBlock)loginSuccessBlock
{
    //正常的登录模式
    //  登录
    EBMLoginViewController *loginVC = [[EBMLoginViewController alloc]initWithLoginSuccessBlock:loginSuccessBlock];
    EBMBaseNavigationController *loginNavigation = [[EBMBaseNavigationController alloc]initWithRootViewController:loginVC];
    
    if(viewController.navigationController)
    {
        if(viewController.navigationController.tabBarController)
        {
            [viewController.navigationController.tabBarController presentViewController:loginNavigation animated:YES completion:nil];
        }
        else
        {
            [viewController presentViewController:loginNavigation animated:YES completion:nil];
        }
    }
    else
    {
        [viewController presentViewController:loginNavigation animated:YES completion:nil];
    }
    
}


@end
